#ifndef COMMON_STRUCT_H
#define COMMON_STRUCT_H
#include "FlightPathMassage.h"
#include <qcolor.h>

const float pi = 3.1415926;


typedef struct
{
    double x;
    double y;
}dvec2;

typedef struct
{
    int64_t x;
    int64_t y;
}ulvec2;

struct ItemAttribute
{
    uint32_t frameID;
    uint32_t targetID;
    float distance;
    float angle;
    bool isUpdated;
};

enum Tracker_state
{
    Active_Tracker,
    Detective_Tracker,
    Expired_Tracker,
    New_Tracker,
    Point,
    ExpiredPoint,
};

enum AreaType
{
    MonitorArea,
    AlertArea,
    Others
};

//ref_zhu
struct ItemAttribute_t
{
    uint32_t frameID;
    uint32_t targetID;
    float Track_Range;
    float Track_Azimuth;
    float Track_PitchAngle;
    float Track_Velocity;
    Tracker_state state;
};

struct TrackerOut
{
    int Track_ID;                     //航迹编号
    int PointNumber;                  //航迹上第几个点
    float Track_Range;                //距离（滤波值）
    float Track_Azimuth;              //方位（滤波值）
    float Track_PitchAngle;           //俯仰（滤波值）
    float Track_Velocity;             //速度（滤波值）
    bool isInterpolatedPoint;         //实际的点or补点
    bool isPointofSecondaryRadar;     //二次雷达
    bool isPointofInterrogator;       //询问机
};



struct ItemMark_t
{
    ItemMark_t(): usRadarType(0), targetID(),color(Qt::black){}
    uint16_t usRadarType;
    uint32_t targetID;
    QColor color;
};

//雷达具体位置信息
typedef struct Radar_Pos_Info_Param_t
{
    Radar_Pos_Info_Param_t(): usRadarType(0), usRecv(0),fRadar_Detection_Distance(0.0),
                          fDirection_Angle(0.0), fStart_Angle(0.0),
                          fEnd_Angle(0.0)
    {
        memset(&LonLat, 0, sizeof(LonLat));
        memset(&CentralLocation, 0, sizeof(CentralLocation));
    }

    uint16_t  usRadarType;
    uint16_t  usRecv;
    dvec2 LonLat;                 //雷达经纬度坐标
    float fRadar_Detection_Distance;
    float fDirection_Angle;
    float fStart_Angle ;
    float fEnd_Angle;

    dvec2 CentralLocation;        //雷达在窗口控件的坐标
}RADAR_POS_INFO_PATAM_T, *PRADAR_POS_INFO_PATAM_T;




typedef struct
{
    int frame;      //圈数
    TargetMessageStruct* target;
}Targets_Info;		// 每次要更新的的数据



////////朱晨曦
//!地图类型
enum MapType
{
    StreetMap,
    SatelliteMap
};

//水滴参数
struct AircraftParam
{
    float distance;
    float angle;
    float speed;
};

enum Cell_Z
{
    MapTile_Z,
    Location_Z,
    MonitoringArea_Z,
    Aircraft_Z,
    LineItem_Z
};

typedef struct Position
{
    int Lon_Degree;
    int Lon_Minute;
    int Lon_Second;
    int Lon_Error;
    int Lat_Degree;
    int Lat_Minute;
    int Lat_Second;
    int Lat_Error;
}Position;

//地图窗口参数
struct RadarParamInfoStruct
{
    dvec2 PosLonLat = {0.0,0.0};
    float fRadarDetectionDistance = 0.0f;
    float fDirectionAngle = 0.0f;
    float fStartAngle = 0.0f;
    float fEndAngle = 0.0f;
    float fNorthOffset = 0.0f;
};

struct TrackerContrallerStruct
{
    uint32_t ID_tobesaved;
    uint32_t ID_tobeDeleted;
    uint32_t ID_todyeing;
    QColor color;
    float fspeed_max;
    float fspeed_min;
};

struct TargetInfoStruct
{
    uint32_t frameID;
    uint32_t targetID;
    float distance;
    float angle;
    QColor color;
    dvec2 pos_;
};

struct colorDefined
{
    int red;
    int green;
    int blue;
};
















#endif // COMMON_STRUCT_H
